<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:dxl="http://www.lotus.com/dxl"
    xmlns:session="java:ro.egmar.dojocache.extensions.SessionExtension"
    exclude-result-prefixes="session dxl xs">
    
    <!-- Output options -->
    <xsl:output
        method="html"
        omit-xml-declaration="yes"
        indent="yes"
    />
    
    <!-- Global parameters -->
    <xsl:param name="webDbPath"/>
    <xsl:param name="notesDbPath"/>
    
    <!-- Strip whitespace -->
    <xsl:strip-space elements="*"/>
    
    <!-- Overriding default templates -->
    <xsl:template match="text()|@*" />
    
    <!-- Template for action -->
    <xsl:template match="dxl:action[@showinbar='true' and not(contains(@title,'\')) and not(contains(@hide,'web'))]">
        <div dojoType="MenuBarItem2" 
            iconSrc="{if (dxl:imageref) then concat('/',$notesDbPath,'/',dxl:imageref/@name) else ''}" 
            caption="{@title}"/>
    </xsl:template>
    
    <!-- Template for actionbar -->
    <xsl:template match="dxl:actionbar">
        <div class="outerPartWorkaround">
            <style type="text/css">
                <xsl:text>.dojoMenuBar2 {</xsl:text>
                <xsl:text>background:</xsl:text>
                <xsl:value-of select="@bgcolor"/>
                <xsl:text>;</xsl:text>
                <xsl:text>}</xsl:text>
            </style>
            <div dojoTYpe="MenuBar2">
                <xsl:apply-templates/>
            </div>
        </div>
    </xsl:template>
    
    <!-- Root template, main entry point -->
    <xsl:template match="/">
        <xsl:apply-templates/>
    </xsl:template>
    
</xsl:stylesheet>